package com.beerandjesus.sportofkings.handicapper.factory.brisnet.singlefile;

import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.Race;
import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.RaceImpl;

public class RaceFactoryImpl extends AbstractObjectFactoryImpl implements RaceFactory {
	
	/* (non-Javadoc)
	 * @see com.beerandjesus.sportofkings.handicapper.factory.brisnet.singlefile.RaceFactory#getRace(java.lang.String)
	 */
	public Race getRace(String dataLine) {
		RaceImpl race = new RaceImpl();
		String[] values = getValues(dataLine);
		
		race.setTrack(val(values,1));
		race.setDate(val(values,2));
		race.setRaceNumber(val(values,3));
		race.setDistanceYards(val(values,6));
		race.setAgeSexRestrictions(val(values,10));
		race.setRaceClassification(val(values,11));
		race.setStateBredFlag(val(values,239));
		race.setPurse(val(values,12));
		race.setClaimingPrice(val(values,13));
		race.setTrackRecord(val(values,15));
		race.setBreedType(val(values,23));
		race.setAllWeatherSurfaceFlag(val(values,25));
		race.setBrisPacePar2f(val(values,214));
		race.setBrisPacePar4f(val(values,215));
		race.setBrisPacePar6f(val(values,216));
		race.setBrisSpeedPar(val(values,217));
		race.setBrisLatePacePar(val(values,218));
		race.setPostTimes(val(values,1374));
		race.setLasixList(val(values,17));
		race.setButeList(val(values,18));
		race.setCoupledList(val(values,19));
		race.setMutuelList(val(values,20));
		
		String surface = val(values,7);
		race.setSurface(u.getTrackSurface(surface));

		String raceType = val(values,9);
		race.setType(u.getRaceType(raceType));
		
		return race;
	}

}
